package com.guigu.servicegoods.mapper;

import com.guigu.servicegoods.domain.TbBrand;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 品牌表 Mapper 接口
 * </p>
 *
 * @author testjava
 * @since 2020-07-08
 */
public interface TbBrandMapper extends BaseMapper<TbBrand> {

    @Select("SELECT name,image FROM tb_brand WHERE id IN (SELECT\n" +
            "brand_id FROM tb_category_brand WHERE category_id IN (SELECT id FROM\n" +
            "tb_category WHERE NAME=#{name}) )ORDER BY seq")
    public List<Map> findListByCategoryName(@Param("name") String categoryName);
}
